home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_7.adf / Source_And_Examples / source / _fpinit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-30  |  1.1 KB  |  55 lines

  1. #ifdef M881
  2. #include <dos.h>
  3. #endif
  4. #include <stdio.h>
  5. #include <proto/exec.h>
  6.  
  7. void __stdargs __fpinit(void);
  8. void __stdargs __fpterm(void);
  9.  
  10. #ifdef FFP
  11. extern struct Library *MathBase;
  12. extern struct Library *MathTransBase;
  13. #else
  14. #ifdef IEEE
  15. extern struct Library *MathIeeeDoubBasBase;
  16. extern struct Library *MathIeeeDoubTransBase;
  17. #endif
  18. #endif
  19.  
  20. extern void (* far __ctors[])(void);
  21. extern void (* far __dtors[])(void);
  22.  
  23.  
  24. void __stdargs __fpinit()
  25. {
  26.    void * volatile p = &__ctors;  /* so GO won't eliminate tst */   
  27.    /* call all the autoinit routines */
  28.    if (p)
  29.    {
  30.        (*__ctors[-1])(); /* this function calls all the others */
  31.    }
  32.  
  33. #ifdef M881
  34.     __emit(0xf23c);        /* put out the instruction FMOVE.L #$00,FPCR */
  35.     __emit(0x9000);        /* This is Round toward nearest and use      */
  36.     __emit(0x0000);        /* Extended precision.                       */
  37.     __emit(0x0000);
  38. #endif
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45. void __stdargs __fpterm()
  46. {
  47.    void * volatile p = &__dtors;  /* so GO won't eliminate tst */   
  48.    /* call all the auto close routines */
  49.    if (p)
  50.    {
  51.        (*__ctors[-1])(); /* this function calls all the others */
  52.    }
  53.  
  54. }
  55.